package com.tempjob.app.vo;

import com.anwen.mongo.annotation.collection.CollectionField;
import com.tempjob.common.businesss.mongo.entity.CompanyInfo;
import com.tempjob.common.model.FullTimeJob;
import com.tempjob.common.model.TempJobInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @author hui
 * @Date 2024/11/4 15:58
 **/
@Data
public class JobListVO {

    @ApiModelProperty("id")
    private String id;

    @ApiModelProperty("公司信息")
    private CompanyInfo companyInfo;

    @ApiModelProperty("工作状态:0未上线1已上线2已下线3强制下线")
    private Integer jobStatus;

    @CollectionField("audit_status")
    @ApiModelProperty("审核状态:1正常2审核失败")
    private Integer auditStatus;

    @ApiModelProperty("工作类型:1零工2正式工3就业基地招聘")
    private Integer jobType;

    @ApiModelProperty("工作分类")
    private String jobCategory;

    @ApiModelProperty("工作分类")
    private String jobCategoryName;

    @ApiModelProperty("标题")
    private String jobTitle;

    @ApiModelProperty("学历要求")
    private String education;

    @ApiModelProperty("技能要求")
    private String skill;

    @ApiModelProperty("经验要求")
    private String experience;

    @ApiModelProperty("全职工作信息")
    private FullTimeJob fullTimeJob;

    @ApiModelProperty("零工工作信息")
    private TempJobInfo tempJobInfo;

    @ApiModelProperty("工作说明")
    private String jobContent;

    @ApiModelProperty("介绍图片")
    private List<String> descImages;

    @ApiModelProperty("待遇标签,提供住宿、无须经验等")
    private List<String> welfareTags;

    @ApiModelProperty("ico")
    private String ico;

    @ApiModelProperty("经度")
    private Double longitude;

    @ApiModelProperty("纬度")
    private Double latitude;

    @ApiModelProperty("省名称")
    private String province;

    @ApiModelProperty("城市名称")
    private String city;

    @ApiModelProperty("区")
    private String district;

    @ApiModelProperty("坐标点所在乡镇/街道（此街道为社区街道，不是道路信息）")
    private String township;

    @ApiModelProperty("地址")
    private String jobAddress;

    @ApiModelProperty("联系电话")
    private String contactPhone;

    @ApiModelProperty("联系人")
    private String contactName;

    @ApiModelProperty("审核人")
    private String auditAdminId;

    @ApiModelProperty("审核人")
    private String auditAdminName;

    @ApiModelProperty("审核内容")
    private String auditDesc;

    @ApiModelProperty("审核时间")
    private Date auditTime;

    @ApiModelProperty("工作属性:1公司发布2企业发布3个人发布")
    private Integer publishNature;

    @ApiModelProperty("发布人id")
    private String publishUserId;

    @ApiModelProperty("发布人")
    private String publishUserName;

    @ApiModelProperty("公司id")
    private String companyId;

    @ApiModelProperty("公司名称")
    private String companyName;

    @ApiModelProperty("工作时间段开始")
    private String workOnTime;

    @ApiModelProperty("工作时间段结束")
    private String workOffTime;

    @ApiModelProperty("截止时间")
    private String deadline;

    @ApiModelProperty("更新时间")
    private Date updateTime;

    @ApiModelProperty("薪资说明")
    private String salaryDesc;

    @ApiModelProperty("申请状态：0或无表示未申请1已申请2不合适3已录用4已删除\")")
    private Integer applyStaus;

    public String getSalaryDesc() {
        if (jobType.equals(1)) {
            salaryDesc = tempJobInfo.getSalaryDesc();
        } else {
            salaryDesc = fullTimeJob.getSalaryDesc();
        }
        return salaryDesc;
    }
}
